home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / p_man / cat3 / Vk / VkOutline.z / VkOutline
Text File  |  1998-10-20  |  16KB  |  463 lines

  1.  
  2.  
  3.  
  4. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      VkOutline - A simple outliner
  10.  
  11. IIIINNNNHHHHEEEERRRRIIIITTTTSSSS FFFFRRRROOOOMMMM
  12.      VkComponent : VkCallbackObject
  13.  
  14. HHHHEEEEAAAADDDDEEEERRRR FFFFIIIILLLLEEEE
  15.      #include <Vk/VkOutline.h>
  16.  
  17. PPPPUUUUBBBBLLLLIIIICCCC PPPPRRRROOOOTTTTOOOOCCCCOOOOLLLL SSSSUUUUMMMMMMMMAAAARRRRYYYY
  18.    CCCCoooonnnnssssttttrrrruuuuccccttttoooorrrr////DDDDeeeessssttttrrrruuuuccccttttoooorrrr
  19.            VkOutline (const char *name, Widget parent);
  20.  
  21.            virtual void ~VkOutline(void);
  22.  
  23.  
  24.    PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrr FFFFuuuunnnnccccttttiiiioooonnnnssss
  25.            void reset(void);
  26.  
  27.  
  28.    AAAAcccccccceeeessssssss FFFFuuuunnnnccccttttiiiioooonnnnssss
  29.            Widget listWidget(void);
  30.  
  31.  
  32.    AAAAddddddddiiiinnnngggg eeeelllleeeemmmmeeeennnnttttssss
  33.            void add(char* parent, char* child);
  34.  
  35.            void addChildren(char** parentPath, char** children);
  36.  
  37.            void addChildren(char** parentPath, char** children,
  38.                             char** keys,
  39.                             void** childrenHooks);
  40.  
  41.            void createPath(char** names, char** keys);
  42.  
  43.  
  44.    DDDDiiiissssppppllllaaaayyyyiiiinnnngggg
  45.            void displayAll(void);
  46.  
  47.            void displayAsKeyword(char** path);
  48.  
  49.            void highlight(char** items, int attrIndex);
  50.  
  51.            void highlight(int itemPos, int attrIndex);
  52.  
  53.            void unhighlight(int attrIndex);
  54.  
  55.  
  56.    AAAAttttttttrrrriiiibbbbuuuutttteeee sssseeeettttttttiiiinnnngggg
  57.            void setIndentationWidth(int width);
  58.  
  59.            void setKeywordAttributes(Pixel fg, Pixel bg,
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  71.  
  72.  
  73.  
  74.                                      XmFontList font);
  75.  
  76.            int  setHighlightAttributes(Pixel fg, Pixel bg,
  77.                                        XmFontList font);
  78.  
  79.  
  80.    TTTToooogggggggglllliiiinnnngggg
  81.            void closePath(char** path);
  82.  
  83.            int effectOfLastToggle(int& from, int& count);
  84.  
  85.            int isPathClosed(char** path);
  86.  
  87.            virtual void toggleChildren(int position);
  88.  
  89.  
  90.    UUUUttttiiiilllliiiittttyyyy
  91.            void getHookAt(int position);
  92.  
  93.            void printTree(void);
  94.  
  95.            void select(int itemPos);
  96.  
  97.            void walkAllKeywords(void* data, void (func*) (void*, VkOlNode*));
  98.  
  99.  
  100. CCCCLLLLAAAASSSSSSSS DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  101.      The VkOutline class provides an ability to display a tree of strings in
  102.      an outline fashion. Each string is displayed in a line with an
  103.      indentation proportional to its depth in the tree. Each non-leaf string
  104.      has a control icon displayed to its left. The control icon denotes
  105.      whether the sub-tree under the string is displayed (open) or not
  106.      (closed). Control icons can be left-clicked by users to toggle between
  107.      open and closed states.
  108.  
  109.      You can build the tree of strings using the add methods, which accept
  110.      names of parent and children). Some add methods allow you to provide an
  111.      additional string for display only, while the name is used for searching
  112.      purpose. Some add methods allow you to associate a user-defined data
  113.      pointer (hook) with the children. Note that you can display more than one
  114.      tree in the outline.  You can treat some strings as "keywords" and
  115.      display them with a different set of attributes (foreground, background,
  116.      font). You can create (up to 4) different display resource ids (by giving
  117.      foreground, background, font) and use them to display a subset of strings
  118.      in the tree.
  119.  
  120.      VkOutline uses VkList to do the actual display.
  121.  
  122. FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNNSSSS
  123.    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee(((())))
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  137.  
  138.  
  139.  
  140.            VkOutline(const char* name, Widget parent);
  141.  
  142.  
  143.           Instantiate a VkOutline object given its name and a widget to act as
  144.           its parent.
  145.  
  146.    ~~~~VVVVkkkkOOOOuuuuttttlllliiiinnnneeee(((())))
  147.            virtual void ~VkOutline(void);
  148.  
  149.  
  150.           Destroy a VkOutline object.
  151.  
  152.    rrrreeeesssseeeetttt(((())))
  153.            void reset(void);
  154.  
  155.  
  156.           Re-initialize the object. Destroys trees built so far. Retains any
  157.           display resources created.
  158.  
  159.    lllliiiissssttttWWWWiiiiddddggggeeeetttt(((())))
  160.            Widget listWidget(void);
  161.  
  162.  
  163.           Provide a handle to the underlying VkList widget used for display.
  164.  
  165.    aaaadddddddd(((())))
  166.            void add(char* parent, char* child);
  167.  
  168.  
  169.           Add a parent-child relation to the tree.
  170.  
  171.    aaaaddddddddCCCChhhhiiiillllddddrrrreeeennnn(((())))
  172.            void addChildren(char** path, char** children);
  173.  
  174.  
  175.           Add several children under the given path. Noop if path does not
  176.           exist.  char* tables should be terminated by NULL pointers.
  177.  
  178.    aaaaddddddddCCCChhhhiiiillllddddrrrreeeennnn(((())))
  179.            void addChildren(char** path, char** display_names,
  180.                             char** children,
  181.                             void* hooks);
  182.  
  183.  
  184.           Add several children under the given path. Names of children
  185.           displayed are taken from display_names, their corresponding search
  186.           names are taken from children and their corresponding user defined
  187.           data (hooks) are taken from hooks. All pointer tables are to be
  188.           followed by a NULL pointer and should be of same size. No op if path
  189.           does not exist.
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  203.  
  204.  
  205.  
  206.    ccccrrrreeeeaaaatttteeeePPPPaaaatttthhhh(((())))
  207.            void createPath(char** display_names, char** path);
  208.  
  209.  
  210.           Create or extend a given path. If path does not exist then a new
  211.           tree is created with first element in path as the root. Otherwise if
  212.           a partial match is found in the existing set of trees by treating
  213.           the first element in the path as the root, then the rest of the
  214.           elements in the path are used to extend the path.  No op if complete
  215.           match is found. Display names are used when fresh strings are added
  216.           to the tree.
  217.  
  218.    pppprrrriiiinnnnttttTTTTrrrreeeeeeee(((())))
  219.            void printTree(void);
  220.  
  221.  
  222.           Prints all the trees to stdout.
  223.  
  224.    ttttoooogggggggglllleeeeCCCChhhhiiiillllddddrrrreeeennnn(((())))
  225.            virtual void toggleChildren(int position);
  226.  
  227.  
  228.           Given the position of the item in the outline display, the subtree
  229.           under that position is closed if already open or opened if already
  230.           closed.
  231.  
  232.    ddddiiiissssppppllllaaaayyyyAAAAllllllll(((())))
  233.            void displayAll(void);
  234.  
  235.  
  236.           All trees in the outline are redisplayed with the default
  237.           attributes.
  238.  
  239.    sssseeeettttIIIInnnnddddeeeennnnttttaaaattttiiiioooonnnnWWWWiiiiddddtttthhhh(((())))
  240.            void setIndentationWidth(int width);
  241.  
  242.  
  243.           Sets indentation width for future displays. Indentation width gives
  244.           the number of pixels which a child string will be right offset from
  245.           its parent.
  246.  
  247.    sssseeeettttKKKKeeeeyyyywwwwoooorrrrddddAAAAttttttttrrrriiiibbbbuuuutttteeeessss(((())))
  248.            void setKeywordAttributes(Pixel fg,
  249.                                      Pixel bg,
  250.                                      XmFontList font);
  251.  
  252.  
  253.           Set display attributes for strings treated as keywords.
  254.  
  255.    sssseeeettttHHHHiiiigggghhhhlllliiiigggghhhhttttAAAAttttttttrrrriiiibbbbuuuutttteeeessss(((())))
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  269.  
  270.  
  271.  
  272.            int setHighlightAttributes(Pixel fg,
  273.                                       Pixel bg,
  274.                                       Pixel scrollbar_bg,
  275.                                       XmFontList font);
  276.  
  277.  
  278.           Create a display resource given a set of display parameters. Returns
  279.           an id which you can use in highlight methods. You can create up to 4
  280.           resource ids.
  281.  
  282.    ddddiiiissssppppllllaaaayyyyAAAAssssKKKKeeeeyyyywwwwoooorrrrdddd(((())))
  283.            void displayAsKeyword(char** path);
  284.  
  285.  
  286.           Treats the string at the end of given path as a keyword and whenever
  287.           it is displayed the parameters set using the setKeywordAttributes
  288.           methods are used.
  289.  
  290.    hhhhiiiigggghhhhlllliiiigggghhhhtttt(((())))
  291.            void highlight(char** children, int id);
  292.  
  293.  
  294.           All children nodes if found will be displayed with the resources
  295.           associated with the given resource id.
  296.  
  297.    hhhhiiiigggghhhhlllliiiigggghhhhtttt(((())))
  298.            void highlight(int item, int id);
  299.  
  300.  
  301.           The node at the given position if valid will be displayed with the
  302.           resources associated with the given resource id.
  303.  
  304.    uuuunnnnhhhhiiiigggghhhhlllliiiigggghhhhtttt(((())))
  305.            void unhighlight(int id);
  306.  
  307.  
  308.           All strings displayed using the given resource id is displayed with
  309.           default resources.
  310.  
  311.    ggggeeeettttHHHHooooooookkkkAAAAtttt(((())))
  312.            void getHookAt(int position);
  313.  
  314.  
  315.           Get the user defined data associated with string in the given
  316.           display position.
  317.  
  318.    cccclllloooosssseeeePPPPaaaatttthhhh(((())))
  319.            void closePath(char** path);
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  335.  
  336.  
  337.  
  338.           Given the path of a string (last item in the path), close the sub-
  339.           tree under the string.
  340.  
  341.    iiiissssPPPPaaaatttthhhhCCCClllloooosssseeeedddd(((())))
  342.            int isPathClosed(char** path);
  343.  
  344.  
  345.           Given the path of a string (last item in the path), test whether
  346.           sub-tree under the string is closed. Returns 1 if closed.
  347.  
  348.    eeeeffffffffeeeeccccttttOOOOffffLLLLaaaassssttttTTTToooogggggggglllleeee(((())))
  349.            int effectOfLastToggle(int& position, int& count);
  350.  
  351.  
  352.           A toggle operation inserts or deletes a set of contiguous strings
  353.           from the outline display. This method returns the position and the
  354.           extent (count) of insertion (return value 1) or deletion (return
  355.           value 0) done as a result of most recent toggle operation on the
  356.           outline (by user or by program).
  357.  
  358.    sssseeeelllleeeecccctttt(((())))
  359.            void select(int itemPos);
  360.  
  361.  
  362.           Select (in the XmList sense) the string displayed at the given
  363.           position
  364.  
  365.    wwwwaaaallllkkkkAAAAllllllllKKKKeeeeyyyywwwwoooorrrrddddssss(((())))
  366.            void walkAllKeywords(void* data, void (*func) (void*, VkOlNode*))
  367.  
  368.  
  369.           Traverses all the strings displayed as keywords to invoke the
  370.           function func.  func is passed two arguments - the first argument is
  371.           the data that is passed to walkAllKeywords and the second argument
  372.           is the pointer to the object (of type VkOlNode) which represents an
  373.           outline item treated as a keyword.  See VkOlNode for accessing
  374.           information about the outline item.
  375.  
  376.    iiiinnnniiiitttt(((())))
  377.            void init(void);
  378.  
  379.  
  380.           Initialization of outline object. All trees created so far are lost.
  381.  
  382. IIIINNNNHHHHEEEERRRRIIIITTTTEEEEDDDD MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  383.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCoooommmmppppoooonnnneeeennnntttt
  384.           installDestroyHandler(), removeDestroyHandler(), widgetDestroyed(),
  385.           setDefaultResources(), getResources(), manage(), unmanage(),
  386.           baseWidget(), okToQuit(), _name, _baseWidget, _w, deleteCallback
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))                                                    VVVVkkkkOOOOuuuuttttlllliiiinnnneeee((((3333xxxx))))
  401.  
  402.  
  403.  
  404.    IIIInnnnhhhheeeerrrriiiitttteeeedddd ffffrrrroooommmm VVVVkkkkCCCCaaaallllllllbbbbaaaacccckkkkOOOObbbbjjjjeeeecccctttt
  405.           callCallbacks(), addCallback(), removeCallback(),
  406.           removeAllCallbacks()
  407.  
  408.  
  409. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  410.      VkComponent, VkCallbackObject
  411.      _V_i_e_w_K_i_t _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  412.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m, DEC Press, Bob Sheifler and Jim Gettys
  413.      _T_h_e _X _W_i_n_d_o_w _S_y_s_t_e_m _T_o_o_l_k_i_t, DEC Press, Paul Asente and Ralph Swick
  414.      _T_h_e _O_S_F/_M_o_t_i_f _P_r_o_g_r_a_m_m_e_r_s _R_e_f_e_r_e_n_c_e, Prentice Hall, OSF
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.